class cDate:
    def __init__(self,y,m,d):
        self.__year=y
        self.__month=m
        self.__day=d

    def setyear(self,y):
        if(y>=1):
            self.__year=y
        else:
            print("输入错误！")
    def setmonth(self,m):
        if(m>=1 and m<=12):
            self.__month=m
        else:
            print("输入错误！")
    def setday(self,d):
        #if(m)根据年月改时间
        if(d>=1 and d<=31):
            self.__day=d
        else:
            print("输入错误！")
    def getmonth(self):
        return self.__month
    month=property(getmonth,setmonth)
    def __str__(self):
        y=2021
        m=5
        d=29
        return f"{self.__year}-{self.__month}-{self.__day}"

    def __sub__(self,other):
        return ((self.__day-other.__day)+(self.__month-other.__month)*30+(self.__year-other.__year)*365)
    def __add__(self,other):
        if(self.__day+other.__day>30):
            self.__month+=1
        if(self.__month+other.__month>12):
            self.__year+=1
        return f"{self.__year+other.__year}-{(self.__month+other.__month)%12}-{(self.__day+other.__day)%30}"
      
print("软工2020-01-05郭枫")
"""def __str__(self):
        self.__Year=(input("请输入借书年份："))
        self.__Month=(input("请输入借书月份："))
        self.__Day=(input("请输入借书日："))
        change = input("是否要更改日期,请回答Y或者N: ").upper()
        if change == "Y":
            self.__Year=(input("请输入借书年份："))
            self.__Month=(input("请输入借书月份："))
            self.__Day=(input("请输入借书日："))
        self.__Year=(input("请输入还书年份："))
        self.__Month=(input("请输入还书月份："))
        self.__Day=(input("请输入还书日："))
        if()"""
d1=cDate(input("请输入借书日："))
change = input("是否要更改日期,请回答Y或者N: ").upper()
if change == "Y":
    d2=cDate(input("请输入借书日："))
d3=cDate(input("请输入借书日："))


s=str(d1)
print(d1)
print(d1-d2)
s2=str(d1+d2)
print(d1+d2)